﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="quan_tri_bai_viet.ascx.cs" Inherits="Admin_Module_quan_tri_bai_viet" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<telerik:RadAjaxManager OnAjaxRequest="Ajax_Request" ID="RadAjaxManager1" runat="server" 
    DefaultLoadingPanelID="RadAjaxLoadingPanel1">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="grd" />
            </UpdatedControls>
        </telerik:AjaxSetting>
       
        <telerik:AjaxSetting AjaxControlID="grd">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="grd" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
</telerik:RadAjaxLoadingPanel>

<telerik:RadWindowManager OnClientClose="Window_Close" ID="RadWindowManager1" runat="server" >
    <Windows>
        <telerik:RadWindow VisibleStatusbar="false" Width="400px" Height="400px" runat="server" ID="windows1"></telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

    <script type="text/javascript">
        function Window_Close() {
            $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
        }

        function openNewsRadWindow() {
            var funtionWindow = window.radopen("/Admin/Form/News_Add.aspx?type=<% Response.Write(NewsType); %>", "windows1");
            funtionWindow.center();
            return false;
        }
    </script>
</telerik:RadCodeBlock>

<asp:Label runat="server" ID="lblMessage"></asp:Label>

<fieldset>
    <legend><span style="color:Blue">QUẢN TRỊ BÀI VIẾT CHIA SẺ</span></legend>
   
   <table width="100%">
        <tr>
            <td style="width:80%">  </td>
            <td align="right"><a href="/Admin/Form/News_Add.aspx" class="link-add-new" ><img src="/Image/add2.png" alt="Thêm mới trang chức năng" title="Thêm mới trang chức năng" />Thêm Mới</a></td>
       </tr>
    </table>
    <telerik:RadGrid runat="server" AllowMultiRowSelection="true" GridLines="Horizontal" Skin="WebBlue" AllowFilteringByColumn="True" AutoGenerateColumns="false" ID="grd">
        <ClientSettings EnableRowHoverStyle="true">
            <Selecting AllowRowSelect="true" />
        </ClientSettings>
        <MasterTableView>
            <Columns>
                <telerik:GridClientSelectColumn UniqueName="SelectColumn" ></telerik:GridClientSelectColumn>
                <telerik:GridBoundColumn Visible="false" DataField="NewsID" HeaderText="ID"></telerik:GridBoundColumn>
                <telerik:GridTemplateColumn  HeaderText="Tiêu đề" DataField="">
                    <ItemTemplate>
                        <a href="/Admin/Form/News_Add.aspx?type=<%# NewsType %>&id=<%#DataBinder.Eval(Container.DataItem,"NewsID")%>">
                            <%# Eval("NewsTitle")%>
                        </a>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn DataField="FunctionPageName" HeaderText="Tên Nhóm" AllowFiltering="true"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="NewsAbstract" Visible="false" HeaderText="Tóm tắt" AllowFiltering="true"></telerik:GridBoundColumn>
                <telerik:GridImageColumn DataImageUrlFields="NewsImage" ImageHeight="80px" ImageWidth="100px" HeaderText="Ảnh" AllowFiltering="true"></telerik:GridImageColumn>
                <telerik:GridBoundColumn DataField="NewsSource" HeaderText="Nguồn" AllowFiltering="true"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="ViewTime" HeaderText="Số lần xem" AllowFiltering="true"></telerik:GridBoundColumn>
                <telerik:GridCheckBoxColumn Display="false" DataField="IsHot" HeaderText="Hot"></telerik:GridCheckBoxColumn>
                <telerik:GridCheckBoxColumn Display="false" DataField="IsNew" HeaderText="Mới"></telerik:GridCheckBoxColumn>
                <telerik:GridCheckBoxColumn Display="false" DataField="IsTypical" HeaderText="Nổi bật"></telerik:GridCheckBoxColumn>
                <telerik:GridCheckBoxColumn Display="false" DataField="IsApproved" HeaderText="Duyệt"></telerik:GridCheckBoxColumn>
                <telerik:GridTemplateColumn HeaderText="Xóa">
                    <ItemTemplate>
                        <asp:LinkButton OnClientClick="return ConfirmDelete()" OnClick="News_Delete" CommandArgument='<%# Eval("NewsID") %>' ID="LinkButton2" runat="server">Xóa</asp:LinkButton>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
</fieldset>